<div id="sidebar">
    <div id="navcontainer">
    <?php
		if($_SESSION['typeid']=='1') {
			// this part is for Administrator menus			
	?>
	    <h1>User Control</h1>
        <ul id="navlist">
            <li id="active"><a href="profile.php" id="current">My Profile</a></li>
            <li><a href="view-all-messages.php">Messages</a></li>
            <li><a href="backup.php">Take Backup</a></li>
		</ul>
        <h1>Projects</h1>
        <ul id="navlist">
            <li><a href="allprojects.php">All Projects</a></li>
            <li><a href="view-all-finished-jobs.php">Completed Jobs</a></li>
            <li><a href="view-all-recent-bids.php">All Recent Bids</a></li>
        </ul>
        <h1>Users</h1>
        <ul id="navlist">
            <li><a href="clients.php">All Clients</a></li>
            <li><a href="contractors.php">All Contractors</a></li>
		</ul>
        <h1>Category</h1>
        <ul id="navlist">
            <li><a href="add-category.php">Add Category</a></li>
            <li><a href="add-sub-category.php">Add Sub Category</a></li>
            <li><a href="view-categories.php">View Categories</a></li>
        </ul>
	<?php
		} elseif($_SESSION['typeid']=='2') {
			// this part is for client menus
	?>
    	<h1>Dashboard</h1>
        <ul id="navlist">
            <li id="active"><a href="profile.php" id="current">My Profile</a></li>
            <li><a href="view-all-messages.php">Messages</a></li>
            <li><a href="post-new-project.php">Post new project</a></li>
            <li><a href="my-contractors.php">My contractors</a></li>
            <li><a href="bids-on-my-projects.php">My Projects</a></li>
        </ul>
	<?php
		} elseif($_SESSION['typeid']=='3') {
			// this part is for contractor menus
	?>
		<h1>Dashboard</h1>    
        <ul id="navlist">
            <li id="active"><a href="profile.php" id="current">My Profile</a></li>
            <li><a href="view-all-messages.php">Messages</a></li>
            <li><a href="completedjobs.php">Completed Jobs</a></li>
            <li><a href="myclients.php">My Clients</a></li>
            <li><a href="applications.php">My Recent Apply</a></li>
        </ul>
	<?php
	    } else {
			$pquery = "SELECT * FROM projects";
			connection();
			$jobs = mysql_query($pquery);
				echo "<ul class=\"recentjobs\">";
					while($recent = mysql_fetch_assoc($jobs)) {
						echo "<li>$recent[ptitle]</li>";
					}
				echo "</ul>";
			}
    ?>
    </div>
</div>